package com.campus.commons.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * <p>
 * 卫生检查表
 * </p>
 *
 * @author Rin
 * @since 2020-12-24
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="CheckHealth对象", description="卫生检查表")
@TableName(excludeProperty={"classRoomName","className","studentName","page","limit"})
public class CheckHealth implements Serializable {
//    检查卫生缓存
    private static final long serialVersionUID = 1L;
    private String classRoomName;
    private String className;
    private String studentName;
    private Integer page;
    private Integer limit;


    public void setClassroomid(Integer classroomid) {
        this.classRoomName = ClassRoom.classrooms.get(classroomid);
        this.classroomid = classroomid;
    }

    public void setClassid(Integer classid) {
        Class aClass = Class.classes.get(classid);
        this.className = aClass.getClassname();
        this.classid = classid;
    }

    public void setStudentid(Integer studentid) {
        this.studentName = Student.students.get(studentid).getStuname();
        this.studentid = studentid;
    }

    @ApiModelProperty(value = "id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "1:上午  2:下午")
    @TableField("isTop")
    private Integer istop;

    @ApiModelProperty(value = "日期")
    private Date date;

    @ApiModelProperty(value = "查的教室")
    @TableField("classRoomId")
    @NotNull(message = "检查不能为空")
    private Integer classroomid;

    @ApiModelProperty(value = "查的班级")
    @TableField(" classId")
    @NotNull(message = "检查班级不能为空")
    private Integer  classid;

    @ApiModelProperty(value = "地面卫生,最高8分")
    @TableField("floorHealth")
    @Size(min = 0,max = 9,message = "地面卫生中最高8分")
    private Integer floorhealth;

    @ApiModelProperty(value = "桌面卫生最高6分")
    @TableField("desktopHealth")
    @Size(max = 7,message = "桌面卫生最高6分")
    private Integer desktophealth;

    @ApiModelProperty(value = "区域卫生最高3分")
    @TableField("areaHealth")
    @Size(max = 4,message = "区域卫生最高3分")
    private Integer areahealth;

    @ApiModelProperty(value = "柜子卫生最高3分")
    @TableField("cabinetHealth")
    @Size(max = 4,message = "柜子卫生最高3分")
    private Integer cabinethealth;

    @ApiModelProperty(value = "检查时间，当前时间精确到秒")
    @TableField("checkTime")

    private Date checktime;

    @ApiModelProperty(value = "值班人员")
    @TableField("studentId")
//    @NotNull(message = "值班人员id")
    private Integer studentid;

    @ApiModelProperty(value = "卫生分数 最多20")
    @Max(value = 21,message = "总分数不能大于20")
    private Integer score;

    @ApiModelProperty(value = "标红 0未标红 1标红")
    @TableField("isRed")
    @NotNull(message = "是否标红?0未标红 1标红")
    private Integer isred;

    @ApiModelProperty(value = "检查图片")
    private String image;


}
